﻿#include "mclock.h"

const QTime &Clock::getTime() const {
    return time;
}

void Clock::setTime(const QTime &newTime) {
    time = newTime;
}

const QString &Clock::getName() const {
    return name;
}

void Clock::setName(const QString &newName) {
    name = newName;
}

const QString &Clock::getDescription() const {
    return description;
}

void Clock::setDescription(const QString &newDescription) {
    description = newDescription;
}

Clock::Clock(QString name, QString description,QTime time,BellRings bellring)
    :name(name),description(description),time(time),bellRing(bellring) {

}

Clock::Clock()
{

}

Clock::Clock(const Clock &clock)
{
    this->name = clock.name;
    this->description = clock.description;
    this->time = clock.time;
}

void Clock::operator=(const Clock &clock)
{
    this->name = clock.name;
    this->description = clock.description;
    this->time = clock.time;
}
int Clock::getRepeat()const {
    return this->repeat;
}

void Clock::addRepeat(REPEAT v)
{
    this->repeat= REPEAT(((int)(this->repeat))|((int)(v)));
}

void Clock::deleteRepeat(REPEAT v)
{
    this->repeat = REPEAT(this->repeat&(~v));
}
void Clock::setRepeat(REPEAT v){
    this->repeat = v;
}
